<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get' || $_RQ['op']){
	$plugin_name=$_RQ['op']?:$_SESSION['current_plugin'];
	if(!$plugin_name){
		exi('请选择应用！','error');
	}
	$tomenus=plugin($plugin_name)->menu();
	$sitemenus=cfc('menus')->get_sitemenus();
	$tomenus[]=$sitemenus;
	if($_RQ['title']){
			$return['params']['title']=$_RQ['title'];
			foreach($tomenus as $k1=>&$item){
				foreach($item['child'] as $k2=>&$pv){
					foreach($pv['child'] as $k3=>$lv){
						if(strpos($lv['title'],$_RQ['title']) !== false){ 
							
						}else{
							unset($pv['child'][$k3]);
						}
					}
					if(!count($pv['child'])){
						unset($item['child'][$k2]);
					}
				}
				if(!count($item['child'])){
					unset($tomenus[$k1]);
				}
			}
	}
	$return['item']['tomenus']=$tomenus;
	$return['htmls']=array(
		array('type'=>'tomenus','title'=>'常用功能','name'=>'tomenus'),
	);
	exi($return);
}